using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using QLKS.DataLayer.BusinessObjects;
using QLKS.DataLayer.Base;

namespace QLKS.DataLayer.ManagerObjects
{
    public partial interface IPhieuThuePhongManager : IManagerBase<PhieuThuePhong, string>
    {
		// Get Methods
		IList<PhieuThuePhong> GetByNguoiLap(System.String nhanVien1);
		IList<PhieuThuePhong> GetByNguoiCapNhat(System.String nhanVien2);
		IList<PhieuThuePhong> GetByMaPhong(System.String phong);
    }

    partial class PhieuThuePhongManager : ManagerBase<PhieuThuePhong, string>, IPhieuThuePhongManager
    {
		#region Constructors
		
		public PhieuThuePhongManager() : base()
        {
        }
        public PhieuThuePhongManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<PhieuThuePhong> GetByNguoiLap(System.String nhanVien1)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(PhieuThuePhong));
			
			
			ICriteria nhanVien1Criteria = criteria.CreateCriteria("NhanVien1");
            nhanVien1Criteria.Add(NHibernate.Criterion.Expression.Eq("Id", nhanVien1));
			
			return criteria.List<PhieuThuePhong>();
        }
		
		public IList<PhieuThuePhong> GetByNguoiCapNhat(System.String nhanVien2)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(PhieuThuePhong));
			
			
			ICriteria nhanVien2Criteria = criteria.CreateCriteria("NhanVien2");
            nhanVien2Criteria.Add(NHibernate.Criterion.Expression.Eq("Id", nhanVien2));
			
			return criteria.List<PhieuThuePhong>();
        }
		
		public IList<PhieuThuePhong> GetByMaPhong(System.String phong)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(PhieuThuePhong));
			
			
			ICriteria phongCriteria = criteria.CreateCriteria("Phong");
            phongCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", phong));
			
			return criteria.List<PhieuThuePhong>();
        }
		
		#endregion
    }
}